#ifndef __VMStack__h__included__
#define __VMStack__h__included__

#include "neiderra/core/Types.h"

using namespace neiderra::types;

namespace neiderra {
	namespace vm {
		class Stack {
		public:
			struct overflow{};
			struct underflow{};
		public:
			Stack(unsigned size);
			~Stack();

			void push(int);
			void push(float);
			void push(char);
			int popi();
			float popf();
			char popc();
			int topi();
            int push(unsigned size, nByte*);
			int pop(int size, nByte*);
			unsigned ptrTop() { return _top; }
			void set(unsigned ptr, unsigned size, nByte*);
			void set(unsigned ptr, unsigned value);
			void get(unsigned ptr, unsigned size, nByte*);
			unsigned getui(unsigned ptr);
			signed geti(unsigned ptr);

		private:
			unsigned char* _mem;
			int _top;
			unsigned _size;
		};
	}
}

#endif
